package com.kakarote.hrm.service;

import com.alibaba.fastjson.JSONObject;
import com.kakarote.common.log.entity.OperationLog;
import com.kakarote.core.entity.BasePage;
import com.kakarote.core.entity.UploadEntity;
import com.kakarote.core.servlet.BaseService;
import com.kakarote.hrm.entity.BO.QueryRecruitPlanPageListBO;
import com.kakarote.hrm.entity.BO.SyncDataInformationBO;
import com.kakarote.hrm.entity.BO.UpdateRecruitPlanStatusBO;
import com.kakarote.hrm.entity.PO.HrmRecruitPlan;
import com.kakarote.hrm.entity.VO.RecruitPlanVO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * <p>
 * 招聘计划表 服务类
 * </p>
 *
 * @author system
 * @since 2024-01-01
 */
public interface IHrmRecruitPlanService extends BaseService<HrmRecruitPlan> {

    /**
     * 添加招聘计划
     *
     * @param recruitPlan 招聘计划
     * @return 操作日志
     */
    OperationLog addRecruitPlan(HrmRecruitPlan recruitPlan);

    /**
     * 修改招聘计划
     *
     * @param recruitPlan 招聘计划
     * @return 操作日志
     */
    OperationLog setRecruitPlan(HrmRecruitPlan recruitPlan);

    /**
     * 获取招聘计划详情
     *
     * @param planId 计划id
     * @return 计划详情
     */
    RecruitPlanVO queryById(Long planId);

    /**
     * 查询招聘计划列表
     *
     * @param queryRecruitPlanPageListBO 查询条件
     * @return 分页结果
     */
    BasePage<RecruitPlanVO> queryRecruitPlanPageList(QueryRecruitPlanPageListBO queryRecruitPlanPageListBO);

    /**
     * 修改招聘计划状态
     *
     * @param updateRecruitPlanStatusBO 状态更新对象
     * @return 操作日志
     */
    OperationLog updateRecruitPlanStatus(UpdateRecruitPlanStatusBO updateRecruitPlanStatusBO);

    /**
     * 导出招聘计划
     *
     * @param response HTTP响应
     * @param queryRecruitPlanPageListBO 查询条件
     * @throws IOException IO异常
     */
    void exportRecruitPlan(HttpServletResponse response, QueryRecruitPlanPageListBO queryRecruitPlanPageListBO) throws IOException;

    /**
     * 根据ID删除招聘计划
     *
     * @param planId 计划ID
     * @return 操作日志
     */
    OperationLog deleteRecruitPlanById(Long planId);

    /**
     * 下载导出模板
     *
     * @param response
     */
    void downloadExcel(HttpServletResponse response);

    /**
     * excel导入计划
     *
     * @param file file
     * @return data
     */
    JSONObject excelImport(MultipartFile file);


    /**
     * 上传临时文件，此文件会七天后删除
     *
     * @param file    文件对象
     * @param batchId batchId
     * @return entity
     */
    UploadEntity uploadTempFile(MultipartFile file, String batchId);

    /**
     * 同步计划回调
     * @param syncDataInformationBO
     * @return
     */
    boolean syncPlanCallback(SyncDataInformationBO syncDataInformationBO);

}
